import styles from './index.module.scss'
type Props = {
  type: string
  onUpdate: (type: string, value: string) => void
  closeInput: () => void
}
const EditList = ({ onUpdate, type, closeInput }: Props) => {
  const genderList = [
    { title: '男', value: '0' },
    { title: '女', value: '1' },
  ]
  const photoList = [
    { title: '拍照', value: '' },
    { title: '本地选择', value: '' },
  ]
  const list = type === 'gender' ? genderList : photoList
  return (
    <div className={styles.root}>
      {/* <div className="list-item">男</div>
      <div className="list-item">女</div> */}
      {list.map((item) => (
        <div
          key={item.title}
          className="list-item"
          onClick={() => onUpdate(type, item.value)}
        >
          {item.title}
        </div>
      ))}
      <div className="list-item" onClick={closeInput}>
        取消
      </div>
    </div>
  )
}

export default EditList
